package jpa.entitys.promis.common;

import java.io.Serializable;

import javax.persistence.*;

import java.math.BigDecimal;
import java.util.Date;


/**
 * The persistent class for the CUST_CRNOTE_INVOICE_REFERENCES database table.
 * 
 */
@Entity
@Table(name="CUST_CRNOTE_INVOICE_REFERENCES")
@NamedQueries({
    @NamedQuery(name = "CustCrnoteInvoiceReference.findAll", query = " SELECT c FROM CustCrnoteInvoiceReference c "),
    @NamedQuery(name = "CustCrnoteInvoiceReference.findById", query = " SELECT c FROM CustCrnoteInvoiceReference c WHERE c.id = :Id "),
    @NamedQuery(name = "CustCrnoteInvoiceReference.findByStatus", query = " SELECT c FROM CustCrnoteInvoiceReference c WHERE c.syncIssync = 'N' And c.status = :status"),
})
public class CustCrnoteInvoiceReference extends jpa.entitys.common.CommonEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	@EmbeddedId
	private CustCrnoteInvoiceReferencePK id;
	
	@Override public String toString() { return org.apache.commons.lang.builder.ToStringBuilder.reflectionToString(this);}

	@Column(name="ADDRESS_CODE", precision=2)
	private BigDecimal addressCode;

	@Column(name="CHARGE_CODE", length=2)
	private String chargeCode;

	@Column(name="CONTRACT_NO", precision=22)
	private BigDecimal contractNo;

	@Column(name="CONTRACT_SEQ", precision=22)
	private BigDecimal contractSeq;

	@Column(name="CONTRACT_SERIES", length=4)
	private String contractSeries;

	@Column(name="CREATED_BY")
	private String createdBy;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="CREATED_ON")
	private Date createdOn;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="CREDIT_NOTE_DATE")
	private Date creditNoteDate;

	@Column(name="CUSTOMER_CODE", length=30)
	private String customerCode;

	@Column(name="DEPARTMENT_CODE", length=30)
	private String departmentCode;

	@Column(name="EXCHANGE_RATE", precision=12, scale=8)
	private BigDecimal exchangeRate;

	@Column(name="INVOICE_CREDIT_AMOUNT", precision=16, scale=2)
	private BigDecimal invoiceCreditAmount;

	@Column(name="INVOICE_NO", precision=6)
	private BigDecimal invoiceNo;

	@Column(name="INVOICE_SEQ", precision=6)
	private BigDecimal invoiceSeq;

	@Column(name="INVOICE_SERIES", length=4)
	private String invoiceSeries;

	@Column(name="INVOICE_TYPE", length=2)
	private String invoiceType;

	@Column(name="LAST_UPD_BY")
	private String lastUpdBy;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="LAST_UPD_ON")
	private Date lastUpdOn;

	@Column(name="NET_INVOICE_CREDIT_AMOUNT", precision=18, scale=2)
	private BigDecimal netInvoiceCreditAmount;

	@Column(length=30)
	private String project;

	@Column(name="REF_NUMBER", precision=6)
	private BigDecimal refNumber;

	@Column(name="REF_SERIES", length=4)
	private String refSeries;

	@Column(name="REF_TYPE", length=2)
	private String refType;

	@Column(length=300)
	private String remarks;

	@Column(name="SERVICE_VAT_FLAG", length=1)
	private String serviceVatFlag;

	@Column(length=1)
	private String status;

	@Column(name="SYNC_CREATEDBY", length=100)
	private String syncCreatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_CREATEDON")
	private Date syncCreatedon;

	@Column(name="SYNC_EXTERNAL_REF_KEY", length=100)
	private String syncExternalRefKey;

	@Column(name="SYNC_EXTERNAL_REF_NO", length=100)
	private String syncExternalRefNo;

	@Column(name="SYNC_ISSTAGING", length=1)
	private String syncIsstaging;

	@Column(name="SYNC_ISSYNC", length=1)
	private String syncIssync;

	@Column(name="SYNC_UPDATEDBY", length=100)
	private String syncUpdatedby;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="SYNC_UPDATEDON")
	private Date syncUpdatedon;

	@Column(name="TAX_RATE", precision=5, scale=2)
	private BigDecimal taxRate;

	@Column(name="TAX_TYPE", length=2)
	private String taxType;

	@Column(name="TAX_TYPE_CODE", length=2)
	private String taxTypeCode;

	@Column(name="TYPE_OF_CONTRACT", length=2)
	private String typeOfContract;

	@Column(name="UNADJUSTED_CREDIT_AMOUNT", precision=16, scale=2)
	private BigDecimal unadjustedCreditAmount;

	@Column(name="UNIT_NUMBER", length=30)
	private String unitNumber;

	@Column(name="VAT_BASE_CREDIT_AMOUNT", precision=16, scale=2)
	private BigDecimal vatBaseCreditAmount;

	@Column(name="VAT_CREDIT_AMOUNT", precision=16, scale=2)
	private BigDecimal vatCreditAmount;

    @Temporal( TemporalType.TIMESTAMP)
	@Column(name="VAT_RECEIPT_DATE")
	private Date vatReceiptDate;

	@Column(name="VAT_RECEIPT_NUMBER", length=15)
	private String vatReceiptNumber;

	@Column(name="WHT_AMOUNT", precision=16, scale=2)
	private BigDecimal whtAmount;

	@Column(name="WHT_PERCENT", precision=5, scale=2)
	private BigDecimal whtPercent;

	//bi-directional many-to-one association to CustomerCreditNote
    @ManyToOne
	@JoinColumns({
		@JoinColumn(name="COMPANY", referencedColumnName="COMPANY", nullable=false, insertable=false, updatable=false),
		@JoinColumn(name="CREDIT_NOTE_NO", referencedColumnName="CREDIT_NOTE_NO", nullable=false, insertable=false, updatable=false),
		@JoinColumn(name="CREDIT_NOTE_SERIES", referencedColumnName="CREDIT_NOTE_SERIES", nullable=false, insertable=false, updatable=false),
		@JoinColumn(name="CREDIT_NOTE_TYPE", referencedColumnName="CREDIT_NOTE_TYPE", nullable=false, insertable=false, updatable=false)
		})
	private CustomerCreditNote customerCreditNote;

    public CustCrnoteInvoiceReference() {
    }

	public CustCrnoteInvoiceReferencePK getId() {
		return this.id;
	}

	public void setId(CustCrnoteInvoiceReferencePK id) {
		this.id = id;
	}
	
	public BigDecimal getAddressCode() {
		return this.addressCode;
	}

	public void setAddressCode(BigDecimal addressCode) {
		this.addressCode = addressCode;
	}

	public String getChargeCode() {
		return this.chargeCode;
	}

	public void setChargeCode(String chargeCode) {
		this.chargeCode = chargeCode;
	}

	public BigDecimal getContractNo() {
		return this.contractNo;
	}

	public void setContractNo(BigDecimal contractNo) {
		this.contractNo = contractNo;
	}

	public BigDecimal getContractSeq() {
		return this.contractSeq;
	}

	public void setContractSeq(BigDecimal contractSeq) {
		this.contractSeq = contractSeq;
	}

	public String getContractSeries() {
		return this.contractSeries;
	}

	public void setContractSeries(String contractSeries) {
		this.contractSeries = contractSeries;
	}

	public String getCreatedBy() {
		return this.createdBy;
	}

	public void setCreatedBy(String createdBy) {
		this.createdBy = createdBy;
	}

	public Date getCreatedOn() {
		return this.createdOn;
	}

	public void setCreatedOn(Date createdOn) {
		this.createdOn = createdOn;
	}

	public Date getCreditNoteDate() {
		return this.creditNoteDate;
	}

	public void setCreditNoteDate(Date creditNoteDate) {
		this.creditNoteDate = creditNoteDate;
	}

	public String getCustomerCode() {
		return this.customerCode;
	}

	public void setCustomerCode(String customerCode) {
		this.customerCode = customerCode;
	}

	public String getDepartmentCode() {
		return this.departmentCode;
	}

	public void setDepartmentCode(String departmentCode) {
		this.departmentCode = departmentCode;
	}

	public BigDecimal getExchangeRate() {
		return this.exchangeRate;
	}

	public void setExchangeRate(BigDecimal exchangeRate) {
		this.exchangeRate = exchangeRate;
	}

	public BigDecimal getInvoiceCreditAmount() {
		return this.invoiceCreditAmount;
	}

	public void setInvoiceCreditAmount(BigDecimal invoiceCreditAmount) {
		this.invoiceCreditAmount = invoiceCreditAmount;
	}

	public BigDecimal getInvoiceNo() {
		return this.invoiceNo;
	}

	public void setInvoiceNo(BigDecimal invoiceNo) {
		this.invoiceNo = invoiceNo;
	}

	public BigDecimal getInvoiceSeq() {
		return this.invoiceSeq;
	}

	public void setInvoiceSeq(BigDecimal invoiceSeq) {
		this.invoiceSeq = invoiceSeq;
	}

	public String getInvoiceSeries() {
		return this.invoiceSeries;
	}

	public void setInvoiceSeries(String invoiceSeries) {
		this.invoiceSeries = invoiceSeries;
	}

	public String getInvoiceType() {
		return this.invoiceType;
	}

	public void setInvoiceType(String invoiceType) {
		this.invoiceType = invoiceType;
	}

	public String getLastUpdBy() {
		return this.lastUpdBy;
	}

	public void setLastUpdBy(String lastUpdBy) {
		this.lastUpdBy = lastUpdBy;
	}

	public Date getLastUpdOn() {
		return this.lastUpdOn;
	}

	public void setLastUpdOn(Date lastUpdOn) {
		this.lastUpdOn = lastUpdOn;
	}

	public BigDecimal getNetInvoiceCreditAmount() {
		return this.netInvoiceCreditAmount;
	}

	public void setNetInvoiceCreditAmount(BigDecimal netInvoiceCreditAmount) {
		this.netInvoiceCreditAmount = netInvoiceCreditAmount;
	}

	public String getProject() {
		return this.project;
	}

	public void setProject(String project) {
		this.project = project;
	}

	public BigDecimal getRefNumber() {
		return this.refNumber;
	}

	public void setRefNumber(BigDecimal refNumber) {
		this.refNumber = refNumber;
	}

	public String getRefSeries() {
		return this.refSeries;
	}

	public void setRefSeries(String refSeries) {
		this.refSeries = refSeries;
	}

	public String getRefType() {
		return this.refType;
	}

	public void setRefType(String refType) {
		this.refType = refType;
	}

	public String getRemarks() {
		return this.remarks;
	}

	public void setRemarks(String remarks) {
		this.remarks = remarks;
	}

	public String getServiceVatFlag() {
		return this.serviceVatFlag;
	}

	public void setServiceVatFlag(String serviceVatFlag) {
		this.serviceVatFlag = serviceVatFlag;
	}

	public String getStatus() {
		return this.status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getSyncCreatedby() {
		return this.syncCreatedby;
	}

	public void setSyncCreatedby(String syncCreatedby) {
		this.syncCreatedby = syncCreatedby;
	}

	public Date getSyncCreatedon() {
		return this.syncCreatedon;
	}

	public void setSyncCreatedon(Date syncCreatedon) {
		this.syncCreatedon = syncCreatedon;
	}

	public String getSyncExternalRefKey() {
		return this.syncExternalRefKey;
	}

	public void setSyncExternalRefKey(String syncExternalRefKey) {
		this.syncExternalRefKey = syncExternalRefKey;
	}

	public String getSyncExternalRefNo() {
		return this.syncExternalRefNo;
	}

	public void setSyncExternalRefNo(String syncExternalRefNo) {
		this.syncExternalRefNo = syncExternalRefNo;
	}

	public String getSyncIsstaging() {
		return this.syncIsstaging;
	}

	public void setSyncIsstaging(String syncIsstaging) {
		this.syncIsstaging = syncIsstaging;
	}

	public String getSyncIssync() {
		return this.syncIssync;
	}

	public void setSyncIssync(String syncIssync) {
		this.syncIssync = syncIssync;
	}

	public String getSyncUpdatedby() {
		return this.syncUpdatedby;
	}

	public void setSyncUpdatedby(String syncUpdatedby) {
		this.syncUpdatedby = syncUpdatedby;
	}

	public Date getSyncUpdatedon() {
		return this.syncUpdatedon;
	}

	public void setSyncUpdatedon(Date syncUpdatedon) {
		this.syncUpdatedon = syncUpdatedon;
	}

	public BigDecimal getTaxRate() {
		return this.taxRate;
	}

	public void setTaxRate(BigDecimal taxRate) {
		this.taxRate = taxRate;
	}

	public String getTaxType() {
		return this.taxType;
	}

	public void setTaxType(String taxType) {
		this.taxType = taxType;
	}

	public String getTaxTypeCode() {
		return this.taxTypeCode;
	}

	public void setTaxTypeCode(String taxTypeCode) {
		this.taxTypeCode = taxTypeCode;
	}

	public String getTypeOfContract() {
		return this.typeOfContract;
	}

	public void setTypeOfContract(String typeOfContract) {
		this.typeOfContract = typeOfContract;
	}

	public BigDecimal getUnadjustedCreditAmount() {
		return this.unadjustedCreditAmount;
	}

	public void setUnadjustedCreditAmount(BigDecimal unadjustedCreditAmount) {
		this.unadjustedCreditAmount = unadjustedCreditAmount;
	}

	public String getUnitNumber() {
		return this.unitNumber;
	}

	public void setUnitNumber(String unitNumber) {
		this.unitNumber = unitNumber;
	}

	public BigDecimal getVatBaseCreditAmount() {
		return this.vatBaseCreditAmount;
	}

	public void setVatBaseCreditAmount(BigDecimal vatBaseCreditAmount) {
		this.vatBaseCreditAmount = vatBaseCreditAmount;
	}

	public BigDecimal getVatCreditAmount() {
		return this.vatCreditAmount;
	}

	public void setVatCreditAmount(BigDecimal vatCreditAmount) {
		this.vatCreditAmount = vatCreditAmount;
	}

	public Date getVatReceiptDate() {
		return this.vatReceiptDate;
	}

	public void setVatReceiptDate(Date vatReceiptDate) {
		this.vatReceiptDate = vatReceiptDate;
	}

	public String getVatReceiptNumber() {
		return this.vatReceiptNumber;
	}

	public void setVatReceiptNumber(String vatReceiptNumber) {
		this.vatReceiptNumber = vatReceiptNumber;
	}

	public BigDecimal getWhtAmount() {
		return this.whtAmount;
	}

	public void setWhtAmount(BigDecimal whtAmount) {
		this.whtAmount = whtAmount;
	}

	public BigDecimal getWhtPercent() {
		return this.whtPercent;
	}

	public void setWhtPercent(BigDecimal whtPercent) {
		this.whtPercent = whtPercent;
	}

	public CustomerCreditNote getCustomerCreditNote() {
		return this.customerCreditNote;
	}

	public void setCustomerCreditNote(CustomerCreditNote customerCreditNote) {
		this.customerCreditNote = customerCreditNote;
	}
	
}